<?php

class lib_code_generator {

    public function __construct() {
        
    }

    public static function generate_random_string($length = 8) {
        $characters = '0123456789abcdefghijklmnopqrst uvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $string = '';
        for ($p = 0; $p < $length; $p++) {
            $num = strlen($characters) - 1;
            $m = mt_rand(0, $num);
            $string .= $characters[$m];
        }
        return $string;
    }

}
